import extraConfigEvent from '@/common/extra-config-event.js';
import { EMIT_PARAMS_OBJ } from '@/utils/constant';
import { $demoi18n } from '@/utils/lang';
import { xvueTheme } from '@/utils/util';

// 常用的本地配置
let config = {
  title: '',
  width: 130,
  componentStyle: xvueTheme,
  tableData: [],
};
if (window.isLocalEnv) {
  config = {
    title: '标题',
    componentStyle: 'dark',
    width: 130,
    backgroundColor: '#fff',
    tableData: [
      {
        name: '吉利莲',
        key: '吉利莲',
        isCheck: true,
      },
      {
        name: '巧克力',
        key: '巧克力',
        isCheck: false,
      },
    ],
  };
}
export default {
  isCustomProertyPannel: true,
  propertyPannelName: `config_${process.env.xvueNameSpace_}select`,
  config: {
    property: {
      title: config.title,
      isTitleSignVisiable: false,
      signMarginLeft: 0,
      verticalLineBackgroundColor: '#00ffff',
      componentStyle: config.componentStyle,
      width: config.width,
      multiple: false, // 是否多选
      multiMaxCount: 100, // 用户勾选时可以选择个数的最大值
      borderRadius: 4,
      backgroundColor: '',
      istitleMarker: false,
      selectNewStyle: 'A',
      extStyles: [],
    },
    data: {
      type: 'custom', // custom & dataSource
      customTableData: config.tableData,
      hasDefaultVal: false,
      defaultVal: '',
      defaultValFrom: 'first',
      defaultValEvent: [],
      dataSourceType: '',
      dataSource: '',
      apiCode: '',
      dataPackage: '',
      dataTable: '',
      redisKey: '',
      tableData: [
        {
          field: 'name',
          mapping: '',
          explain: 'panelData.explain.optionName',
        },
        {
          field: 'key',
          mapping: '',
          explain: 'panelData.explain.filterVal',
        },
        {
          field: 'label',
          mapping: '',
          explain: 'panelData.explain.filterGroup',
          skipVerification: true,
        },
      ],
    },
  },
  advancedLinkage: {},
  events: [
    {
      id: 'dd78804b-bec6-4a36-a60f-469090969e2e',
      key: 'select-changed',
      label: '下拉项改变',
      type: 'out',
      description: '',
      parameters: [
        {
          id: 'dd78804b-bec6-4a36-a60f-469090969e2e',
          key: 'key',
          label: 'panelEvent.label.eventKey',
          value: '',
        },
        {
          id: 'dd788002-bec2-4a32-a602-469090969e22',
          key: EMIT_PARAMS_OBJ,
          label: '发出参数对象',
          hide: true,
          value: '',
        },
      ],
    },
    {
      id: 'c85c5869-1000-rgbn-9b7a-1b7f04c8523c',
      key: '',
      label: '',
      type: 'in',
      description: '',
      parameters: [
        {
          id: '1eaa1000-1000-4882-b77b-782wsdfac7db',
          key: 'key-0',
          label: '',
          value: '',
        },
      ],
    },
    {
      id: '0000001-7162-bnmj-9b7a-1b7f04c85999',
      key: '',
      label: '',
      type: 'in',
      description: '',
      parameters: [
        {
          id: '1eaa3598-6e9a-grvs-b77b-782tgbfac999',
          key: 'key-1',
          label: '',
          value: '',
        },
      ],
    },
    {
      id: '0000002-d315-11ea-988b-c71201010d36',
      key: '',
      label: '',
      type: 'in',
      description: '',
      parameters: [
        {
          id: '8f42b8f0-d315-11ea-988b-c71201010d36',
          key: 'key-2',
          label: '',
          value: '',
        },
      ],
    },
    {
      id: '0000003-d315-11ea-988b-c71201010d36',
      key: '',
      label: '',
      type: 'in',
      description: '',
      parameters: [
        {
          id: 'f4cf9440-d315-11ea-bf46-2557ecf0db55',
          key: 'key-3',
          label: '',
          value: '',
        },
      ],
    },
    {
      id: '0000004-d315-11ea-bf46-2557ecf0db55',
      key: '',
      label: '',
      type: 'in',
      description: '',
      parameters: [
        {
          id: 'f4d141f1-d315-11ea-bf46-2557ecf0db55',
          key: 'key-4',
          label: '',
          value: '',
        },
      ],
    },
    {
      id: '0000005-1000-rgbn-9b7a-1b7f04c8523c',
      key: '',
      label: '',
      type: 'in',
      description: '',
      parameters: [
        {
          id: '1eaa1000-1000-4882-b77b-782wsdfac7db',
          key: 'key-5',
          label: '',
          value: '',
        },
      ],
    },

    {
      id: '0000006-1010-rgbn-9b7a-1b7f04c8523c',
      key: '',
      label: '',
      type: 'in',
      description: '',
      parameters: [
        {
          id: '1eaa1000-1010-4882-b77b-782wsdfac7db',
          key: 'key-6',
          label: '',
          value: '',
        },
      ],
    },
    {
      id: '0000007-1002-rgbn-9b7a-1b7f04c8523c',
      key: '',
      label: '',
      type: 'in',
      description: '',
      parameters: [
        {
          id: '1eaa1000-1002-4882-b77b-782wsdfac7db',
          key: 'key-7',
          label: '',
          value: '',
        },
      ],
    },
    {
      id: '0000008-1003-rgbn-9b7a-1b7f04c8523c',
      key: '',
      label: '',
      type: 'in',
      description: '',
      parameters: [
        {
          id: '1eaa1000-1003-4882-b77b-782wsdfac7db',
          key: 'key-8',
          label: '',
          value: '',
        },
      ],
    },
    {
      id: '0000009-1003-rgbn-9b7a-1b7f04c8523c',
      key: '',
      label: '',
      type: 'in',
      description: '',
      parameters: [
        {
          id: '1eaa1000-1009-4882-b77b-782wsdfac7db',
          key: 'key-9',
          label: '',
          value: '',
        },
      ],
    },
    ...extraConfigEvent,
  ],
};
